package org.micode.common.file;

import org.micode.common.utils.DateUtils;
import org.micode.common.domain.base.BaseUserCache;
import lombok.Data;

@Data
public class FileUploadVO {

    /** id */
    private Long fileId;

    /** 上传文件的用户类型，参见 UploadUserTypeEnum */
    private Integer userType;

    /** 上传文件的用户ID */
    private BaseUserCache currentUser;

    /** 上传文件的UserID */
    private Long userId;

    /** URL地址 */
    private String url;

    /** 原文件名 */
    private String sourceName;

    /** 现文件名 */
    private String filename;

    /** 文件类型， 参见 UploadFileTypeEnum */
    private Integer fileType;

    /** 业务类型 */
    private String bizType;

    /** 语言类型 */
    private String langType;

    /** 业务类型 */
    private Long fileSize;

    /** 上传日期，YYYYMMDD */
    private String dateStr;

    /** 说明 */
    private String description;

    public FileUploadVO() {
        this.dateStr = DateUtils.strYYYYMMDD();
    }

    public FileUploadVO(Long fileId,
                        Integer userType,
                        BaseUserCache currentUser,
                        String url,
                        String sourceName,
                        String filename,
                        Integer fileType,
                        Long fileSize,
                        String bizType,
                        String langType,
                        String description) {
        this();
        this.fileId = fileId;
        this.userType = userType;
        this.currentUser = currentUser;
        this.url = url;
        this.sourceName = sourceName;
        this.filename = filename;
        this.fileType = fileType;
        this.fileSize = fileSize;
        this.bizType = bizType;
        this.langType = langType;
        this.description = description;
    }

    @Override
    public String toString() {
        return "FileUploadVO{" +
                "fileId=" + fileId +
                ", userType=" + userType +
                ", userId=" + userId +
                ", currentUser=" + currentUser +
                ", url='" + url + '\'' +
                ", sourceName='" + sourceName + '\'' +
                ", filename='" + filename + '\'' +
                ", fileType=" + fileType +
                ", fileSize=" + fileSize +
                ", bizType=" + bizType +
                ", langType=" + langType +
                ", dateStr='" + dateStr + '\'' +
                ", description='" + description + '\'' +
                '}';
    }

}
